<?php include "../public/header.php";?>
<?php include "../public/header_edit.php";?>
<link rel="stylesheet" type="text/css" href="/static/component/laytp/module/cityPicker/city-picker.css">

<body id="optPage">
<form class="layui-form layui-form-pane" id="commentForm">
    <div class="page-title"><div class="page-title-con"><span>设置提成状态</span><div class="move_title"></div><?php include "../public/sub.php";?></div></div>
    <div class="main-container">


        <div class="block-generic">
            <div class="layui-form-item ">
                <div class="layui-row layui-col-space10">
                    <div class="layui-col-md12">
                        <label class="layui-form-label"><text>*</text>提成是否发放</label>
                        <div class="layui-input-block">
                            <select id="ischeng" name="ischeng" lay-filter="ischeng" >
                                <option value="是">是</option>
                                <option value="否">否</option>
                            </select>
                            <p class="error" id="ischeng_error" style="margin: 0;"></p>
                        </div>
                    </div>
                </div>
            </div>
            <div class="layui-form-item ">
                <div class="layui-row layui-col-space10">
                    <div class="layui-col-md12">
                        <label class="layui-form-label">发放说明</label>
                        <div class="layui-input-block">
                            <input type="text" name="chengshuo" id="chengshuo" placeholder="请输入" clearable autocomplete="off" class="layui-input">
                        </div>
                    </div>
                </div>
            </div>
        </div>

    </div>
</form>
<script>
    var param_ids = getQueryVariable('ids') || '';

    layui.use(['laytp', 'form'], function() {
        var form = layui.form, layer = layui.layer;
        render_input_attr();

        form.on('submit(add)', function(data){

            var validRes = $("#commentForm").valid();


            if(data.field.ischeng == ''){
                $('#ischeng_error').show().text('请选择');
                $('#ischeng_error').parent().find('input').addClass('select_error');
                validRes = false;
            }else{
                $('#ischeng_error').hide();
                $('#ischeng_error').parent().find('input').removeClass('select_error');
            }

            if(!validRes){return false;}


            data.field.ids = param_ids;
            facade.ajax({url: ask_bid_cheng, data:data.field}).done(function(res){
                if (res.code === 2000) {
                    dataPostTimeOut();
                }
            });

            return false;
        });

    });




</script>
</body>
</html>
